package com.west.xu.redis.receiver;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

@Component
public class PrimaryRedisReceiver implements MessageListener {
    private static final Logger LOG = LoggerFactory.getLogger(PrimaryRedisReceiver.class);

    @Override
    public void onMessage(Message message, byte[] pattern) {
        LOG.info("[Primary]监听到Redis消息 : Channel ==>" + new String(message.getChannel()) + " | Data ==>" + new String(message.getBody()));
    }
}
